Trac is being migrated to new services! Issues can be found in our new
YouTrack instance and WIKI pages can be found on our
website.
- Timestamp:
-
Apr 27, 2007, 8:39:48 PM (17 years ago)
- Author:
-
John Bailey
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v5
|
v6
|
|
41 | 41 | Without this, on Windows systems the opened files will use Windows default translation (<CR><LF> for newline, for example). This will cause errors due to newline format and the "bytes read" counts, which will be wrong when comparing the return value of `read()` to `stat()`. |
42 | 42 | |
43 | | === Why are there `G_DIR_SEPARATOR_S` and `G_DIR_SEPARATOR` usages everywhere? === |
| 43 | === Why is `G_DIR_SEPARATOR_S` and `G_DIR_SEPARATOR` used everywhere? === |
44 | 44 | This is a matter of maintaining cross-platform compatibility. Windows uses a backslash ("\") for directory separators in paths, while UNIX-like systems use the forward slash ("/"). Other OSes may choose to use other separators--for example, prior to Mac OS X, it was common for the directory separator on Macs to be a colon (":"). It is impractical to use preprocessor directives throughout the code to determine the path style to use, especially if a new OS were to appear and use a different directory separator. GLib, which we already use, provides the convenient separator macro, so we use this to reduce our code complexity and maintain cross-platform portability. |
45 | 45 | |
… |
… |
|
50 | 50 | === Should I use `snprintf()` or `vsnprintf()`? === |
51 | 51 | No. Use the GLib wrapper functions instead. They are `g_snprintf()` and `g_vsnprintf`. |
| 52 | |
| 53 | === How do I get the settings directory? === |
| 54 | Use `purple_home_dir()`. You should ''not'' use `g_get_home_dir()` or `getenv("HOME")`. |
52 | 55 | |
53 | 56 | == Headers == |
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!